import Layout from "@/layout/index.vue";
import LayoutNo from "@/layout/noLeft.vue";

const defaultRoutes = [{
  path: '/',
  redirect: '/myFile',
  component: Layout,
  children: [
    // 首页
    {
      path: '/home',
      name: 'Home',
      component: () => import("@/views/home/home.vue"),
      meta: {
        title: "首页",
        breadCrumb: [{
          title: '首页'
        }]
      },
    },
    // 我的文件
    {
      path: '/myFile',
      name: 'MyFile',
      component: () => import("@/views/myFile/myFile.vue"),
      meta: {
        title: "我的文件",
        breadCrumb: [{
          title: '我的文件'
        }]
      },
    },
    // 文件汇编
    {
      path: '/fileCompilation',
      name: 'FileCompilation',
      component: () => import("@/views/fileCompilation/fileCompilation.vue"),
      meta: {
        title: "文件汇编",
        breadCrumb: [{
          title: '文件汇编'
        }]
      },
    },
    // 信息发布
    {
      path: '/messagePublic',
      name: 'MessagePublic',
      component: () => import("@/views/messagePublic/messagePublic.vue"),
      meta: {
        title: "信息发布",
        breadCrumb: [{
          title: '信息发布'
        }]
      },
    },
    // 目录管理
    {
      path: '/catalogue',
      name: 'Catalogue',
      component: () => import("@/views/catalogue/catalogue.vue"),
      meta: {
        title: "目录管理",
        breadCrumb: [{
          title: '目录管理'
        }]
      },
    },
    // 用户管理
    {
      path: '/users',
      name: 'Users',
      component: () => import("@/views/setting/users/users.vue"),
      meta: {
        title: "用户管理"
      },
    },
    // 流程图
    // {
    //   path: '/processonEdit',
    //   name: 'ProcessonEdit',
    //   component: (resolve) => require(['@/views/processon/processonEdit'], resolve),
    //   meta: {
    //     title: "流程设计",
    //     breadCrumb: [{
    //       title: '流程设计'
    //     }]
    //   },
    // },
    // processON团队
    {
      path: '/processOn',
      name: 'ProcessOn',
      component: (resolve) => require(['@/views/processon/index'], resolve),
      meta: {
        title: "流程设计",
        breadCrumb: [{
          title: '流程设计'
        }]
      },
    },
  ]
},
{
  path: '/processonEdit',
  component: LayoutNo,
  meta: {
    title: "流程设计"
  },
  children: [
    // 用户管理
    {
      path: '/processonEdit',
      name: 'ProcessonEdit',
      component: (resolve) => require(['@/views/processon/processonEdit'], resolve),
      meta: {
        title: "流程设计"
      },
    },

  ]
},
// 系统设置
{
  path: '/setting',
  component: Layout,
  meta: {
    title: "系统设置"
  },
  children: [
    // 用户管理
    {
      path: '/users',
      name: 'Users',
      component: () => import("@/views/setting/users/users.vue"),
      meta: {
        title: "用户管理"
      },
    },
    // 角色管理
    {
      path: '/roles',
      name: 'Roles',
      component: () => import("@/views/setting/roles/roles.vue"),
      meta: {
        title: "角色管理"
      },
    },
    // 菜单管理
    {
      path: '/menus',
      name: 'Menus',
      component: () => import("@/views/setting/menus/menus.vue"),
      meta: {
        title: "菜单管理"
      },
    },
    // 日志管理
    // {
    //   path: '/logs',
    //   name: 'Logs',
    //   component: () => import("@/views/setting/logs/logs.vue"),
    //   meta: {
    //     title: "日志管理"
    //   },
    // },
  ]
},
{
  path: '/login',
  component: (resolve) => require(['@/views/login'], resolve),
  hidden: true
},
{
  path: "/error",
  name: "Error",
  component: Layout,
  children: [{
    path: '/404',
    component: (resolve) => require(['@/views/error/404'], resolve),
    hidden: true
  },
  {
    path: '/400',
    component: (resolve) => require(['@/views/error/400'], resolve),
    hidden: true
  },
  ]
},
]

export default defaultRoutes;
